<%--
  Created by IntelliJ IDEA.
  User: admin
  Date: 2023/3/3
  Time: 10:27
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>商品列表</title>
    <script src="webjars/jquery/3.6.0/jquery.min.js"></script>
    <link rel="stylesheet" href="webjars/bootstrap/3.4.1/css/bootstrap.min.css">
    <script src="webjars/bootstrap/3.4.1/js/bootstrap.min.js"></script>
    <style>
        .container{
            margin-top: 20px;
        }
        .panel-footer{
            text-align: right;
        }
        .table{
            text-align: center;
        }
    </style>
</head>

<body>
        <div class="container">
            <div class="panel panel-primary">
                <div class="panel-heading">
                    <h3 class="panel-title">拼夕夕商品列表</h3>
                </div>
                <table class="table table-hover table-striped">
                    <tr>
                        <td>商品编号</td>
                        <td>商品名称</td>
                        <td>单价</td>
                        <td>库存</td>
                        <td>操作</td>
                    </tr>
                    <c:forEach items="${products}" var="p">
                    <tr>
                        <td>${p.key}</td>
                        <td>${p.value.pname}</td>
                        <td>${p.value.price}</td>
                        <td>${p.value.quantity}</td>
                        <td>
                            <a href="/cart?cmd=add&pid=${p.key};" class="btn-sm btn-success">加入购物车</a>
                        </td>
                    </tr>
                    </c:forEach>
                </table>
                <div class="panel-footer text-right">
                    拼夕夕2.3
                </div>
            </div>
        </div>
</body>
</html>
